<template>
  <div id="examinationResult">
    <div class="examinationResultCon" v-if="testResultData.length">
      <h2 class="title">{{$route.params.reportTime | filterDate }}<span>&nbsp;</span><span class="blue">{{$route.params.reportName}}</span></h2>
      <div class="col-md-12 boxShadow">
        <h2 class="boxTitle">图像所见</h2>
        <div class="boxContent">
          {{testResultData[0].TXT}}
        </div>
      </div>
      <div class="col-md-12 boxShadow">
        <h2 class="boxTitle">诊断意见</h2>
        <div class="boxContent">
          {{testResultData[0].Opinion}}
        </div>
      </div>
    </div>
    <loading v-if="!testResultData.length"></loading>
  </div>
</template>
<script>
  import { apiInspectionDetails } from '@/api/api'
  import loading from '@/components/loading/loading'
  export default {
    data() {
      return {
        testResultData: []
      }
    },
    activated() {
      this.getInspectionDetails();
    },
    methods: {
      getInspectionDetails() {
        this.testResultData = [];
        apiInspectionDetails({
          InspectionReportID: this.$route.params.idReport,
          type: this.$route.params.ReportPage
        })
          .then(res => {
            if (JSON.parse(res).Status == 1) {
              this.testResultData = JSON.parse(res).Data;
              //console.log(this.testResultData)
            }
          })
          .catch(err => {
            this.$toast.center('当前请求接口有问题，请联系管理员！！')
          });
      }
    },

    filters: {
      filterDate(time) {
        if (!time) {
          return time;
        } else {
          time = time.replace(/\//g, '-');
          return time.substring(0, 10);
        }
      }
    },
    components: {
      loading 
    }
  }

</script>
<style scoped>
  #examinationResult {
    padding: 35px 50px;
  }

  .examinationResultCon {
    height: 100%;
    width: 100%;
  }

  .title {
    font-size: 18px;
    color: #000;
  }

  .blue {
    color: #11a7f3;
  }

  .title span {
    margin-right: 15px;
  }
  .boxShadow{
    padding:15px;
    box-shadow:0 0 5px #ddd;
    min-height:200px;
    margin-top:20px;
    border-radius:8px;
  }
  .boxTitle{
   font-size:16px;
  }
  .boxContent {
    text-indent: 20px;
    margin-top: 10px;
    letter-spacing: 2px;
  }
  @media screen and (max-width: 768px) {
}
@media screen and (max-width: 425px) {
  #examinationResult {
    padding: 35px 30px;
  }
}
</style>
